<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>04-在组件上使用v-model</title>
</head>
<body>
  <div id="app">
    <input-demo
      :value='searchText'
      v-on:input='searchText = $event'
    ></input-demo>
    
  </div>
  
</body>
<script src="./vue1111.js"></script>
<script>
  Vue.component('input-demo',{
    props: ['value'],
    template:`<input v-bind:value='value' v-on:input="$emit('input',$event.target.value)">`
  });
  new Vue({
    el:'#app'
  })
</script>
</html>